3.2460 \(\int x (a+b x^n)^2 \, dx\)

Optimal. Leaf size=44 \[ \frac {a^2 x^2}{2}+\frac {2 a b x^{n+2}}{n+2}+\frac {b^2 x^{2 (n+1)}}{2 (n+1)} \]

[Out]

1/2*a^2*x^2+1/2*b^2*x^(2+2*n)/(1+n)+2*a*b*x^(2+n)/(2+n)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {270} \[ \frac {a^2 x^2}{2}+\frac {2 a b x^{n+2}}{n+2}+\frac {b^2 x^{2 (n+1)}}{2 (n+1)} \]

Antiderivative was successfully verified.

[In]

Int[x*(a + b*x^n)^2,x]

[Out]

(a^2*x^2)/2 + (b^2*x^(2*(1 + n)))/(2*(1 + n)) + (2*a*b*x^(2 + n))/(2 + n)

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int x \left (a+b x^n\right )^2 \, dx &=\int \left (a^2 x+2 a b x^{1+n}+b^2 x^{1+2 n}\right ) \, dx\\ &=\frac {a^2 x^2}{2}+\frac {b^2 x^{2 (1+n)}}{2 (1+n)}+\frac {2 a b x^{2+n}}{2+n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 37, normalized size = 0.84 \[ \frac {1}{2} x^2 \left (a^2+\frac {4 a b x^n}{n+2}+\frac {b^2 x^{2 n}}{n+1}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*x^n)^2,x]

[Out]

(x^2*(a^2 + (4*a*b*x^n)/(2 + n) + (b^2*x^(2*n))/(1 + n)))/2

________________________________________________________________________________________

fricas [A]  time = 0.84, size = 72, normalized size = 1.64 \[ \frac {{\left (b^{2} n + 2 \, b^{2}\right )} x^{2} x^{2 \, n} + 4 \, {\left (a b n + a b\right )} x^{2} x^{n} + {\left (a^{2} n^{2} + 3 \, a^{2} n + 2 \, a^{2}\right )} x^{2}}{2 \, {\left (n^{2} + 3 \, n + 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*x^n)^2,x, algorithm="fricas")

[Out]

1/2*((b^2*n + 2*b^2)*x^2*x^(2*n) + 4*(a*b*n + a*b)*x^2*x^n + (a^2*n^2 + 3*a^2*n + 2*a^2)*x^2)/(n^2 + 3*n + 2)

________________________________________________________________________________________

giac [B]  time = 0.18, size = 87, normalized size = 1.98 \[ \frac {b^{2} n x^{2} x^{2 \, n} + 4 \, a b n x^{2} x^{n} + a^{2} n^{2} x^{2} + 2 \, b^{2} x^{2} x^{2 \, n} + 4 \, a b x^{2} x^{n} + 3 \, a^{2} n x^{2} + 2 \, a^{2} x^{2}}{2 \, {\left (n^{2} + 3 \, n + 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*x^n)^2,x, algorithm="giac")

[Out]

1/2*(b^2*n*x^2*x^(2*n) + 4*a*b*n*x^2*x^n + a^2*n^2*x^2 + 2*b^2*x^2*x^(2*n) + 4*a*b*x^2*x^n + 3*a^2*n*x^2 + 2*a
^2*x^2)/(n^2 + 3*n + 2)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 47, normalized size = 1.07 \[ \frac {2 a b \,x^{2} {\mathrm e}^{n \ln \relax (x )}}{n +2}+\frac {b^{2} x^{2} {\mathrm e}^{2 n \ln \relax (x )}}{2+2 n}+\frac {a^{2} x^{2}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*x^n)^2,x)

[Out]

1/2*a^2*x^2+1/2*b^2/(n+1)*x^2*exp(n*ln(x))^2+2*a*b/(n+2)*x^2*exp(n*ln(x))

________________________________________________________________________________________

maxima [A]  time = 0.46, size = 40, normalized size = 0.91 \[ \frac {1}{2} \, a^{2} x^{2} + \frac {b^{2} x^{2 \, n + 2}}{2 \, {\left (n + 1\right )}} + \frac {2 \, a b x^{n + 2}}{n + 2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*x^n)^2,x, algorithm="maxima")

[Out]

1/2*a^2*x^2 + 1/2*b^2*x^(2*n + 2)/(n + 1) + 2*a*b*x^(n + 2)/(n + 2)

________________________________________________________________________________________

mupad [B]  time = 1.24, size = 43, normalized size = 0.98 \[ \frac {a^2\,x^2}{2}+\frac {b^2\,x^{2\,n}\,x^2}{2\,n+2}+\frac {2\,a\,b\,x^n\,x^2}{n+2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a + b*x^n)^2,x)

[Out]

(a^2*x^2)/2 + (b^2*x^(2*n)*x^2)/(2*n + 2) + (2*a*b*x^n*x^2)/(n + 2)

________________________________________________________________________________________

sympy [A]  time = 0.53, size = 201, normalized size = 4.57 \[ \begin {cases} \frac {a^{2} x^{2}}{2} + 2 a b \log {\relax (x )} - \frac {b^{2}}{2 x^{2}} & \text {for}\: n = -2 \\\frac {a^{2} x^{2}}{2} + 2 a b x + b^{2} \log {\relax (x )} & \text {for}\: n = -1 \\\frac {a^{2} n^{2} x^{2}}{2 n^{2} + 6 n + 4} + \frac {3 a^{2} n x^{2}}{2 n^{2} + 6 n + 4} + \frac {2 a^{2} x^{2}}{2 n^{2} + 6 n + 4} + \frac {4 a b n x^{2} x^{n}}{2 n^{2} + 6 n + 4} + \frac {4 a b x^{2} x^{n}}{2 n^{2} + 6 n + 4} + \frac {b^{2} n x^{2} x^{2 n}}{2 n^{2} + 6 n + 4} + \frac {2 b^{2} x^{2} x^{2 n}}{2 n^{2} + 6 n + 4} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*x**n)**2,x)

[Out]

Piecewise((a**2*x**2/2 + 2*a*b*log(x) - b**2/(2*x**2), Eq(n, -2)), (a**2*x**2/2 + 2*a*b*x + b**2*log(x), Eq(n,
 -1)), (a**2*n**2*x**2/(2*n**2 + 6*n + 4) + 3*a**2*n*x**2/(2*n**2 + 6*n + 4) + 2*a**2*x**2/(2*n**2 + 6*n + 4)
+ 4*a*b*n*x**2*x**n/(2*n**2 + 6*n + 4) + 4*a*b*x**2*x**n/(2*n**2 + 6*n + 4) + b**2*n*x**2*x**(2*n)/(2*n**2 + 6
*n + 4) + 2*b**2*x**2*x**(2*n)/(2*n**2 + 6*n + 4), True))

________________________________________________________________________________________